﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Profile;
using System.Web.Security;

namespace Webs.Models
{
    public class UserProfile : ProfileBase
    {
        public string FirstName
        {
            get { return this["FirstName"] as string; }
            set { this["FirstName"] = value; }
        }

        public string LastName
        {
            get { return this["LastName"] as string; }
            set { this["LastName"] = value; }
        }

        public static UserProfile GetUserProfileByName(string username)
        {
            return Create(username) as UserProfile;
        }

        public static UserProfile GetUserProfile()
        {
            return Create(Membership.GetUser().UserName) as UserProfile;
        }

        public static UserProfile GetUserProfileByKey(string id)
        {
            return Create(Membership.GetUser(new Guid(id)).UserName) as UserProfile;
        }
    }//End Class
}